.class public Lcom/xingbook/ting/receiver/PlayerStateReceiver;
.super Landroid/content/BroadcastReceiver;


# instance fields
.field private a:Lcom/xingbook/ting/receiver/b;


# direct methods
.method public constructor <init>(Lcom/xingbook/ting/receiver/b;)V
    .locals 1

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/xingbook/ting/receiver/PlayerStateReceiver;->a:Lcom/xingbook/ting/receiver/b;

    iput-object p1, p0, Lcom/xingbook/ting/receiver/PlayerStateReceiver;->a:Lcom/xingbook/ting/receiver/b;

    return-void
.end method


# virtual methods
.method public a(Landroid/content/Context;)V
    .locals 2

    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    const-string v1, "com.xingpark.ting.play.musicplayer.action.PAUSED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v1, "com.xingpark.ting.play.musicplayer.action.PLAYING"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v1, "com.xingpark.ting.play.musicplayer.action.PREPARING"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v1, "com.xingpark.ting.play.musicplayer.action.RETRIEVING"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v1, "com.xingpark.ting.play.musicplayer.action.STOPPED"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    const-string v1, "com.xingpark.ting.play.musicplayer.action.COMPLETION"

    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    invoke-virtual {p1, p0, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    return-void
.end method

.method public b(Landroid/content/Context;)V
    .locals 0

    invoke-virtual {p1, p0}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    return-void
.end method

.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 2

    const-string v0, "com.xingpark.ting.play.musicplayer.action.PAUSED"

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/xingbook/ting/receiver/PlayerStateReceiver;->a:Lcom/xingbook/ting/receiver/b;

    invoke-interface {v0}, Lcom/xingbook/ting/receiver/b;->e()V

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v0, "com.xingpark.ting.play.musicplayer.action.PLAYING"

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/xingbook/ting/receiver/PlayerStateReceiver;->a:Lcom/xingbook/ting/receiver/b;

    invoke-interface {v0}, Lcom/xingbook/ting/receiver/b;->d()V

    goto :goto_0

    :cond_2
    const-string v0, "com.xingpark.ting.play.musicplayer.action.PREPARING"

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    iget-object v0, p0, Lcom/xingbook/ting/receiver/PlayerStateReceiver;->a:Lcom/xingbook/ting/receiver/b;

    invoke-interface {v0}, Lcom/xingbook/ting/receiver/b;->c()V

    goto :goto_0

    :cond_3
    const-string v0, "com.xingpark.ting.play.musicplayer.action.RETRIEVING"

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_4

    iget-object v0, p0, Lcom/xingbook/ting/receiver/PlayerStateReceiver;->a:Lcom/xingbook/ting/receiver/b;

    invoke-interface {v0}, Lcom/xingbook/ting/receiver/b;->b()V

    goto :goto_0

    :cond_4
    const-string v0, "com.xingpark.ting.play.musicplayer.action.STOPPED"

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_5

    iget-object v0, p0, Lcom/xingbook/ting/receiver/PlayerStateReceiver;->a:Lcom/xingbook/ting/receiver/b;

    invoke-interface {v0}, Lcom/xingbook/ting/receiver/b;->a()V

    goto :goto_0

    :cond_5
    const-string v0, "com.xingpark.ting.play.musicplayer.action.COMPLETION"

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ting/receiver/PlayerStateReceiver;->a:Lcom/xingbook/ting/receiver/b;

    invoke-interface {v0}, Lcom/xingbook/ting/receiver/b;->f()V

    goto :goto_0
.end method
